/*
 * audioEngine.hpp
 *
 *  Created on: Aug 28, 2013
 *      Author: jason
 */

#ifndef AUDIOENGINE_HPP_
#define AUDIOENGINE_HPP_

#include <string>
#include <SFML/Audio.hpp>
#include <unordered_map>

class AudioEngine {
public:
	~AudioEngine();
	static AudioEngine* instance();
	static void KillInstance();
	void addAudioFile(const std::string filename);
	// We will probably want to have the ability to use multiple music files
	// per map. An example would be, walking from the general town into a
	// shop or bar. Another would be in the battles where there would be
	// frequent changes between music
	void addMusicFile(const std::string filename);
	sf::SoundBuffer* getBufferByFilename(std::string filename);
	void fadeInMusic();
	void fadeOutMusic();
	void setAttenuationForMusicFile(std::string filename,
			const sf::Vector3f pos, float attenuation);
private:
	AudioEngine();
	static AudioEngine* m_pInstance;
	std::unordered_map<std::string, sf::Music* > musicMap;
	std::unordered_map<std::string, sf::Sound* > audioMap;
};


#endif /* AUDIOENGINE_HPP_ */
